import Layout from '@/views/layout/index.vue'
import Register from '@/views/login/components/Register.vue'
import Login from '@/views/login/index.vue'
import Forget from '@/views/login/components/Forget.vue'
import Abnormal from '@/views/abnormal/index.vue'

const routes = [
  {
    path: '/',
    name: 'layout',
    component: Layout,
    redirect: '/home',
    meta: {
      title: 'layout',
      hidden: false,
    },
    children: [
      {
        path: '/home',
        name: 'home',
        component: () => import('@/views/home/index.vue'),
        meta: {
          icon: 'House',
          title: '首页',
          hidden: false,
        },
      },
    ],
  },
  {
    path: '/screen',
    name: 'screen',
    component: () => import('@/views/screen/index.vue'),
    meta: {
      icon: 'PieChart',
      title: '数据大屏',
      hidden: false,
    },
  },
  {
    path: '/acl',
    name: 'acl',
    component: Layout,
    redirect: '/acl/user',
    meta: {
      icon: 'Lock',
      title: '权限管理',
      hidden: false,
    },
    children: [
      {
        path: '/acl/user',
        name: 'user',
        component: () => import('@/views/acl/user/index.vue'),
        meta: {
          icon: 'User',
          title: '用户管理',
          hidden: false,
        },
      },
      {
        path: '/acl/role',
        name: 'role',
        component: () => import('@/views/acl/role/index.vue'),
        meta: {
          icon: 'Connection',
          title: '角色管理',
          hidden: false,
        },
      },
    ],
  },
  {
    path: '/register',
    name: 'register',
    component: Register,
    meta: {
      title: '注册',
      hidden: true,
    },
  },
  {
    path: '/login',
    name: 'login',
    component: Login,
    meta: {
      title: '登录',
      hidden: true,
    },
  },
  {
    path: '/forget',
    name: 'forget',
    component: Forget,
    meta: {
      title: '忘记密码',
      hidden: true,
    },
  },
  {
    path: '/abnormal',
    name: 'abnormal',
    component: Abnormal,
    meta: {
      title: 'NotFound',
      hidden: true,
    },
  },
  {
    path: '/:pathMatch(.*)*',
    name: 'any',
    component: Abnormal,
    redirect: '/abnormal',
    meta: {
      title: 'NotFound',
      hidden: true,
    },
  },
]

export default routes
